package func;

import java.util.ArrayList;

public class ConditionalIntegerFuncs implements FunctionGroup<Integer> {
	public ArrayList<Function<Integer>> createFunctionGroup() {
		ArrayList<Function<Integer>> f = new ArrayList<Function<Integer>>();
		
		f.add(new Function<Integer>() {
			public Integer applyFunction(Integer[] param) {
				if(param[0] != 0)
					return param[1];
				else
					return param[2];
			}
			public String description() {
				return "i_if";
			}
			public int paramCount() {
				return 3;
			}			
		});

		f.add(new Function<Integer>() {
			public Integer applyFunction(Integer[] param) {
				if(param[0] > param[1])
					return 1;
				else
					return 0;
			}
			public String description() {
				return "i_grt";
			}
			public int paramCount() {
				return 2;
			}			
		});
		
		f.add(new Function<Integer>() {
			public Integer applyFunction(Integer[] param) {
				if(param[0] == param[1])
					return 1;
				else
					return 0;
			}
			public String description() {
				return "i_eq";
			}
			public int paramCount() {
				return 2;
			}			
		});

		return f;
	}
	public String description() {
		return "conditionalinteger";
	}
}
